#ifndef DATA_OBSERVER_H
#define DATA_OBSERVER_H

#include "Observer.h"
#include <utility>
#include <any>
#include "Data/FileContextWrapper.h"

class ISubject;
#include "DesignPattern/ObserverVisitor.h" // 添加这一行来包含 ObserverVisitor 的定义


class DataObserver : public Observer {
public:
    DataObserver(const std::any& data) : data_(data) {}

    virtual ~DataObserver() = default;

    virtual void accept(ObserverVisitor& visitor, ISubject* subject) override {
        visitor.visitDataObserver(this, subject, data_);
    }

    virtual void onPlaybackStarted() override;
    virtual void onPlaybackStopped() override;
private:
    std::any data_;
};
#endif // DATA_OBSERVER_H
